<div ng-if="vm.invenioSearchResults.hits.total != 0">
  <div class="list-group">
    <div class="list-group-item record-elem" ng-repeat="record in vm.invenioSearchResults.hits.hits track by $index">
      <div class="pull-left">
        <div class="btn btn-sm btn-link">
          <i class="glyphicon glyphicon-{{ record.status!=='published' && 'open' || 'saved' }} text-{{ record.status=='published' && 'success' || 'danger' }}"></i>
        </div>
      </div>
      <div class="pull-left">
        <span class="label label-info" data-container="div" bs-tooltip data-title="Publication date" ng-if="record.metadata.publication_date">{{ record.metadata.publication_date|date:'longDate' }}{{ record.conceptrecid ? ' (' + (record.metadata.version || ('v' + (record.metadata.relations.version[0].index + 1))) + ')' : '' }}</span>
        <span class="label label-default" ng-if="record.metadata.resource_type">{{ record.metadata.resource_type.title }}</span>
        <span ng-switch on="record.metadata.access_right">
          <span ng-switch-when="embargoed">
            <span class="label label-{{record.metadata.access_right_category}} titlecase" bs-tooltip data-container="div" data-placement="top" data-title="Available as Open Access after {{ record.metadata.embargo_date|date:'longDate' }}">{{ record.metadata.access_right }} Access</span>
          </span>
          <span ng-switch-default>
            <span class="label label-{{record.metadata.access_right_category}} titlecase" ng-if="record.metadata.access_right">{{ record.metadata.access_right }} Access</span>
          </span>
        </span>
        <h4><a target="_self" ng-href="/{{record.status!=='published' && 'deposit' || 'record'}}/{{record.status!=='published' && record.id || record.recid }}">{{ record.metadata.title || "Untitled" }}</a></h4>
        <p class="list-group-item-text text-muted">
          <small>
            Created {{ record.created|date:'medium' }}, modified {{ record.updated|date:'medium' }}

          </small>
        </p>
        <p ng-if="!vm.invenioSearchArgs.all_versions && record.metadata.relations.version[0].count > 1">
          <span class="text-muted hidden-xs"><a href ng-click="vm.invenioSearchArgs.q = 'conceptrecid:' + record.conceptrecid; vm.invenioSearchArgs.all_versions = true; vm.invenioSearchArgs.sort='-version';"><small><i>{{ record.metadata.relations.version[0].count - 1 }} more version(s) exist for this record</i></small></a></span>
        </p>
      </div>
      <div class="clearfix"></div>
    </div>
  </div>
</div>
<div ng-if="vm.invenioSearchResults.hits.total == 0 && vm.invenioSearchArgs.q">
  <div class="list-group">
    <div class="list-group-item">
      <div class="jumbotron" align="center" class="hidden-sm hidden-xs">
        <h3>Empty search result</h1>
        <h1>
          <a class="btn btn-success btn-lg" href="/deposit/new">
            <i class="fa fa-upload"></i> New upload
          </a>
        </h1>
      </div>
    </div>
  </div>
</div>
<div ng-if="vm.invenioSearchResults.hits.total == 0 && !vm.invenioSearchArgs.q && vm.invenioSearchResults.aggregations.status.buckets.length == 0">
  <div class="list-group">
    <div class="list-group-item">
      <div class="jumbotron" align="center" class="hidden-sm hidden-xs">
        <h1>Get started!</h1>{{}}
        <p>Make your first upload - all research outputs from across all fields of research are welcome.</p>
        <h1>
          <a class="btn btn-success btn-lg" href="/deposit/new">
            <i class="fa fa-upload"></i> New upload
          </a>
        </h1>
      </div>
    </div>
  </div>
</div>
<div ng-if="vm.invenioSearchResults.hits.total == 0 && !vm.invenioSearchArgs.q && vm.invenioSearchResults.aggregations.status.buckets.length != 0">
  <div class="list-group">
    <div class="list-group-item">
      <div class="jumbotron" align="center" class="hidden-sm hidden-xs">
        <h1>Research. Shared.</h1>{{}}
        <p>All research outputs from across all fields of research are welcome.</p>
        <h1>
          <a class="btn btn-success btn-lg" href="/deposit/new">
            <i class="fa fa-upload"></i> New Upload
          </a>
        </h1>
      </div>
    </div>
  </div>
</div>
